<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/6
 * Time: 11:25
 */

header('Access-Control-Allow-Origin:*');//跨域
if($_SERVER["REQUEST_METHOD"]=="POST"){
    if($_REQUEST["uuname"]=="aaa"&&$_REQUEST["uupwd"]=="123"){
        $arr=array();
        $arr["status"]=1;
        $arr["msg"]="登录成功";
        print_r(json_encode($arr));
    }else{
        $arr=array();
        $arr["status"]=0;
        $arr["msg"]="用户名或密码错误";
        print_r(json_encode($arr));
    }
}
else{
    $arr=array();
    $arr["status"]=0;
    $arr["msg"]="请使用post";

    //将数组转换为json
    print_r(json_encode($arr));
}

//if($_SERVER["REQUEST_METHOD"]=="POST"){
//    $uname=$_REQUEST["uname"];
//    $upawd=$_REQUEST["upwd"];
//
//    print_r($uname);
//    print_r( $upawd);
//}
